//api文件仍保留但不建议使用，推荐使用models中的api。API files remain preserved (deprecated), use models APIs instead.
import type { DbConnection, DbConnectionResponse } from './types.js';

import { requestClient } from '#/api/request';

export const getuctooDbConnectionList = async (page: number, pageSize: number,
  searchParams?: any) => {
  return requestClient.get<DbConnectionResponse>(`/uctoo/db_connection/${pageSize}/${page}`,{
    params: searchParams,
  });
};

export const getuctooDbConnection = async (id: string) => {
  return requestClient.get<DbConnection>(`/uctoo/db_connection/${id}`);
};

export const adductooDbConnection = async (data: Partial<DbConnection>) => {
  return requestClient.post<DbConnection>('/uctoo/db_connection/add', data);
};

export const edituctooDbConnection = async (data: Partial<DbConnection>) => {
  return requestClient.post<DbConnection>('/uctoo/db_connection/edit', data);
};

export const deleteuctooDbConnection = async (id: string) => {
  return requestClient.post<any>('/uctoo/db_connection/del', { id });
};
